package com.platform.hjt.erp.model;

import java.sql.Timestamp;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.hibernate.annotations.GenericGenerator;

import com.platform.hjt.sys.model.SysCompanyInfo;
import com.platform.hjt.sys.model.SysUserInfo;
import com.platform.hjt.sys.model.json.SysCompanyInfoSerialize;
import com.platform.hjt.sys.model.json.SysUserInfoSerialize;

/**
 * ErpOrderInfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "erp_order_info")
public class ErpOrderInfo implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -8161080176896794232L;
	private String erpOrderInfoId;
	private SysCompanyInfo sysCompanyInfo;
	private SysUserInfo sysUserInfo;
	private String orderType;
	private Double orderDeposit;
	private Double orderTotalPrice;
	private String orderNum;
	private String recipientName;
	private String recipientUnit;
	private String recipientPhone;
	private String targetProvince;
	private String targetCity;
	private String targetArea;
	private String targetAddress;
	private Boolean isInsure;
	private Timestamp payTime;
	private Timestamp createTime;
	private String remark;
	private Boolean isDel;
	
	//流程实例ID
	private String processId;

	// Constructors

	/** default constructor */
	public ErpOrderInfo() {
	}

	/** minimal constructor */
	public ErpOrderInfo(String erpOrderInfoId) {
		this.erpOrderInfoId = erpOrderInfoId;
	}

	/** full constructor */
	public ErpOrderInfo(String erpOrderInfoId, SysCompanyInfo sysCompanyInfo,
			SysUserInfo sysUserInfo, String orderType, Double orderDeposit,
			Double orderTotalPrice, String orderNum, String recipientName,
			String recipientUnit, String recipientPhone, String targetProvince,
			String targetCity, String targetArea, String targetAddress,
			Boolean isInsure, Timestamp payTime, Timestamp createTime,
			String remark, Boolean isDel,
			Set<ErpOrderInfoDetail> erpOrderInfoDetails) {
		this.erpOrderInfoId = erpOrderInfoId;
		this.sysCompanyInfo = sysCompanyInfo;
		this.sysUserInfo = sysUserInfo;
		this.orderType = orderType;
		this.orderDeposit = orderDeposit;
		this.orderTotalPrice = orderTotalPrice;
		this.orderNum = orderNum;
		this.recipientName = recipientName;
		this.recipientUnit = recipientUnit;
		this.recipientPhone = recipientPhone;
		this.targetProvince = targetProvince;
		this.targetCity = targetCity;
		this.targetArea = targetArea;
		this.targetAddress = targetAddress;
		this.isInsure = isInsure;
		this.payTime = payTime;
		this.createTime = createTime;
		this.remark = remark;
		this.isDel = isDel;
	}

	// Property accessors
	@Id
	@GenericGenerator(name="systemUUID",strategy="uuid")
	@GeneratedValue(generator="systemUUID")
	@Column(name = "erp_order_info_id", unique = true, nullable = false, length = 32)
	public String getErpOrderInfoId() {
		return this.erpOrderInfoId;
	}

	public void setErpOrderInfoId(String erpOrderInfoId) {
		this.erpOrderInfoId = erpOrderInfoId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "sys_company_info_id")
	@JsonSerialize(using = SysCompanyInfoSerialize.class)
	public SysCompanyInfo getSysCompanyInfo() {
		return this.sysCompanyInfo;
	}

	public void setSysCompanyInfo(SysCompanyInfo sysCompanyInfo) {
		this.sysCompanyInfo = sysCompanyInfo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "sys_user_info_id")
	@JsonSerialize(using = SysUserInfoSerialize.class)
	public SysUserInfo getSysUserInfo() {
		return this.sysUserInfo;
	}

	public void setSysUserInfo(SysUserInfo sysUserInfo) {
		this.sysUserInfo = sysUserInfo;
	}

	@Column(name = "order_type", length = 1)
	public String getOrderType() {
		return this.orderType;
	}

	public void setOrderType(String orderType) {
		this.orderType = orderType;
	}

	@Column(name = "order_deposit", precision = 22, scale = 0)
	public Double getOrderDeposit() {
		return this.orderDeposit;
	}

	public void setOrderDeposit(Double orderDeposit) {
		this.orderDeposit = orderDeposit;
	}

	@Column(name = "order_total_price", precision = 22, scale = 0)
	public Double getOrderTotalPrice() {
		return this.orderTotalPrice;
	}

	public void setOrderTotalPrice(Double orderTotalPrice) {
		this.orderTotalPrice = orderTotalPrice;
	}

	@Column(name = "order_num", length = 50)
	public String getOrderNum() {
		return this.orderNum;
	}

	public void setOrderNum(String orderNum) {
		this.orderNum = orderNum;
	}

	@Column(name = "recipient_name", length = 50)
	public String getRecipientName() {
		return this.recipientName;
	}

	public void setRecipientName(String recipientName) {
		this.recipientName = recipientName;
	}

	@Column(name = "recipient_unit", length = 200)
	public String getRecipientUnit() {
		return this.recipientUnit;
	}

	public void setRecipientUnit(String recipientUnit) {
		this.recipientUnit = recipientUnit;
	}

	@Column(name = "recipient_phone", length = 20)
	public String getRecipientPhone() {
		return this.recipientPhone;
	}

	public void setRecipientPhone(String recipientPhone) {
		this.recipientPhone = recipientPhone;
	}

	@Column(name = "target_province", length = 50)
	public String getTargetProvince() {
		return this.targetProvince;
	}

	public void setTargetProvince(String targetProvince) {
		this.targetProvince = targetProvince;
	}

	@Column(name = "target_city", length = 50)
	public String getTargetCity() {
		return this.targetCity;
	}

	public void setTargetCity(String targetCity) {
		this.targetCity = targetCity;
	}

	@Column(name = "target_area", length = 50)
	public String getTargetArea() {
		return this.targetArea;
	}

	public void setTargetArea(String targetArea) {
		this.targetArea = targetArea;
	}

	@Column(name = "target_address", length = 500)
	public String getTargetAddress() {
		return this.targetAddress;
	}

	public void setTargetAddress(String targetAddress) {
		this.targetAddress = targetAddress;
	}

	@Column(name = "is_insure")
	public Boolean getIsInsure() {
		return this.isInsure;
	}

	public void setIsInsure(Boolean isInsure) {
		this.isInsure = isInsure;
	}

	@Column(name = "pay_time", length = 19)
	public Timestamp getPayTime() {
		return this.payTime;
	}

	public void setPayTime(Timestamp payTime) {
		this.payTime = payTime;
	}

	@Column(name = "create_time", length = 19)
	public Timestamp getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

	@Column(name = "remark", length = 500)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "is_del")
	public Boolean getIsDel() {
		return this.isDel;
	}

	public void setIsDel(Boolean isDel) {
		this.isDel = isDel;
	}

	@Column(name = "process_id")
	public String getProcessId() {
		return processId;
	}

	public void setProcessId(String processId) {
		this.processId = processId;
	}

}